package com.arg.friday.controller;

import com.arg.friday.dao.MockDatabase;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;

@Controller
public class Mvc {
    @Resource
    private MockDatabase mockDatabase;
    @GetMapping(value = "/showDogs")
    public ModelAndView show(){
        return new ModelAndView(){{
            setViewName("viewer");
            addObject("dogs",mockDatabase.getDogs());
            addObject("hello",mockDatabase.getHello());
            addObject("flag",mockDatabase.getFlag());
        }};
    }
}
